From 66740dea41f2772d46e1b13b91ef0e7b1a68bfff Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 6 Feb 2023 16:40:14 -0800 Subject: new pinpad component --- .../[username]/settings/[...tab]/+page.svelte | 8 +- .../(app)/[username]/settings/[...tab]/_pos.svelte | 2 +- .../[username]/settings/[...tab]/_security.svelte | 161 ++++++++------------- 3 files changed, 64 insertions(+), 107 deletions(-) (limited to 'src/routes/(app)/[username]/settings') diff --git a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte index 1e8b31ce..5638a22b 100644 --- a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte +++ b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte @@ -5,7 +5,7 @@ import { Icon, Spinner, Pin } from '$comp'; import { t } from '$lib/translations'; - import { failure, post, success } from '$lib/utils'; + import { fail, post, success } from '$lib/utils'; import { avatar, banner, password, pin } from '$lib/store'; import { upload } from '$lib/upload'; import { page } from '$app/stores'; @@ -34,7 +34,7 @@ $: form?.success && success('Settings saved!'); $: if (form?.message?.startsWith('Pin')) { - failure('Wrong pin, try again'); + fail('Wrong pin, try again'); $pin = ''; } @@ -98,7 +98,7 @@ applyAction(result); } catch (e) { console.log(e); - failure('Something went wrong'); + fail('Something went wrong'); } loading = false; @@ -109,7 +109,7 @@ {#if loaded && user.haspin && $pin?.length !== 6} - + {/if}
import { Icon, LocaleSelector, Toggle } from '$comp'; import { t } from '$lib/translations'; - import { success, failure } from '$lib/utils'; + import { success, fail } from '$lib/utils'; import { page } from '$app/stores'; export let user, rates; diff --git a/src/routes/(app)/[username]/settings/[...tab]/_security.svelte b/src/routes/(app)/[username]/settings/[...tab]/_security.svelte index cf969f1c..eb3b405e 100644 --- a/src/routes/(app)/[username]/settings/[...tab]/_security.svelte +++ b/src/routes/(app)/[username]/settings/[...tab]/_security.svelte @@ -1,80 +1,52 @@ @@ -155,31 +147,10 @@

{$t('user.settings.securityPINDescription')}

- {#if settingPin} -
-
-
- - - - - - - - -
-
- - - - - - - - -
-
-
+ {#if verifying} + + {:else if settingPin} + {:else} {:else if user.twofa} - {:else} - {/if} + + {#if confirming2fa || disabling2fa} + + {/if}
-- cgit v1.2.3